﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<TPOJ.Model.ForumMessage>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
	Post New Message
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">

    <h2>Post new message on Problem <%= Html.Encode(Model.ProblemId) %></h2>
    
    <% using (Html.BeginForm())
       {%>
       <%= Html.HiddenFor(model=>model.ProblemId) %>
        <fieldset>
            <legend>Share a buzz</legend>
            
            <% if (!Request.IsAuthenticated) {%>
        <h3>Please Login First.</h3>
        <%} else {%>

            <div class="editor-label">
                Title
            </div>
            <div class="editor-field">
                <%= Html.TextBoxFor(model => model.Title)%>
                <%= Html.ValidationMessageFor(model => model.Title)%>
            </div>
            
            <div class="editor-label">
                Content
            </div>
            <div class="editor-field">
                <%= Html.TextAreaFor(model => model.MessageContent, new { rows = 10, cols = 80 })%>
                <%= Html.ValidationMessageFor(model => model.MessageContent)%>
            </div>
            
            <p>
                <input type="submit" value="Post" />
            </p>
        <% } %>
        </fieldset>

    <% } %>
  
    <div>
        <%=Html.ActionLink("Back", "Index", new { id = Model.ProblemId })%>
    </div>

</asp:Content>

